import { apiClient } from './apiService'

export const commentService = {
  // 获取影片评论列表
  getCommentsByMovie: async (movieId ,params) => {
    return await apiClient.get(`/comments/movie/${movieId}`,{params})
  },

  // 获取用户评论列表
  getUserComments: async (userId) => {
    return await apiClient.get(`/comments/user/${userId}`)
  },

  // 创建评论
  createComment: async (commentData) => {
    return await apiClient.post('/comments', commentData)
  },

  // 更新评论
  updateComment: async (commentId, commentData) => {
    return await apiClient.put(`/comments/${commentId}`, commentData)
  },

  // 删除评论
  deleteComment: async (commentId) => {
    return await apiClient.delete(`/comments/${commentId}`)
  },

  // 审核评论
  approveComment: async (commentId) => {
    return await apiClient.put(`/comments/${commentId}/approve`)
  },

  // 拒绝评论
  rejectComment: async (commentId) => {
    return await apiClient.put(`/comments/${commentId}/reject`)
  }
}